package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.ProjectHoursMapper;
import com.ruoyi.crm.domain.ProjectHours;
import com.ruoyi.crm.service.IProjectHoursService;

/**
 * 项目工时Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-30
 */
@Service
public class ProjectHoursServiceImpl implements IProjectHoursService
{
    @Autowired
    private ProjectHoursMapper projectHoursMapper;

    /**
     * 查询项目工时
     *
     * @param id 项目工时主键
     * @return 项目工时
     */
    @Override
    public ProjectHours selectProjectHoursById(String id)
    {
        return projectHoursMapper.selectProjectHoursById(id);
    }

    /**
     * 查询项目工时列表
     *
     * @param projectHours 项目工时
     * @return 项目工时
     */
    @Override
    public List<ProjectHours> selectProjectHoursList(ProjectHours projectHours)
    {
        return projectHoursMapper.selectProjectHoursList(projectHours);
    }

    /**
     * 新增项目工时
     *
     * @param projectHours 项目工时
     * @return 结果
     */
    @Override
    public int insertProjectHours(ProjectHours projectHours)
    {
        return projectHoursMapper.insertProjectHours(projectHours);
    }

    /**
     * 修改项目工时
     *
     * @param projectHours 项目工时
     * @return 结果
     */
    @Override
    public int updateProjectHours(ProjectHours projectHours)
    {
        projectHours.setUpdateTime(DateUtils.getNowDate());
        return projectHoursMapper.updateProjectHours(projectHours);
    }

    /**
     * 批量删除项目工时
     *
     * @param ids 需要删除的项目工时主键
     * @return 结果
     */
    @Override
    public int deleteProjectHoursByIds(String[] ids)
    {
        return projectHoursMapper.deleteProjectHoursByIds(ids);
    }

    /**
     * 删除项目工时信息
     *
     * @param id 项目工时主键
     * @return 结果
     */
    @Override
    public int deleteProjectHoursById(String id)
    {
        return projectHoursMapper.deleteProjectHoursById(id);
    }
}